//
//  ChatHandleCommonLogic.m
//  NLProjectFrameworkDemo
//
//  Created by iosdeveloper on 2020/4/28.
//  Copyright © 2020 yj_zhang. All rights reserved.
//

#import "ChatHandleCommonLogic.h"
#import "ShowMessageViewController.h"
#import "UIView+NLCustomHud.h"
//#import "YYPhotoBrowseView.h"






@interface ChatHandleCommonLogic()
@property(nonatomic,strong)ShowMessageViewController*showVC;
@end


@implementation ChatHandleCommonLogic
+(TIMCustomElem*)getCustomElemModel:(NSData*)josnData{
   
    TIMCustomElem * custom_elem = [[TIMCustomElem alloc] init];
    custom_elem.data =josnData;
    return custom_elem;
}

+(void)jumpPhotoChangeBig:(NSString*)imgUrl  baseVC:(UINavigationController*)basNav{
   
//    UIView * fromV = [[UIView alloc]initWithFrame:CGRectMake(IMSCREEN_WIDTH/2.0, IMSCREEN_HEIGHT/2.0, 0.1, 0.1)];
//       YYPhotoGroupItem*photoItem = [YYPhotoGroupItem new];
//       photoItem.largeImageURL = [NSURL URLWithString:imgUrl];
//       NSMutableArray * groupItems = [NSMutableArray new];
//       [groupItems addObject:photoItem];
//       YYPhotoBrowseView * browseView = [[YYPhotoBrowseView alloc]initWithGroupItems:groupItems];
//       [browseView presentFromImageView:fromV toContainer:basNav.view animated:YES completion:nil];
}

+(NSDictionary*)getDicFromPath:(NSString*)path{
  
       NSData*jsonData=[[NSData alloc]initWithContentsOfFile:path];
       NSDictionary*dic =[NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingAllowFragments error:nil];
    return dic;
}

-(void)handleChatVCReceiveTecentDelegate:(NSString*)status baseVC:(UIViewController*)baseVC{
   if ([status isEqualToString:USER_ONLINE_OFF_RECONNECT])
    {
        [baseVC.view nlShowHudText:@"重新连接失败" hideDelay:2.0 completionBlock:^{

        }];

    }else if ([status isEqualToString:USER_USERIGE_SIGEXPIRED]){
        [baseVC.view nlShowHudText:@"用户登录过期" hideDelay:2.0 completionBlock:^{

        }];
    }

}

-(void)jumpSystemSetting{
    NSURL * url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
    if ( [[UIApplication sharedApplication] canOpenURL: url] ) {
        [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
    }

}
@end
